闘本 4.4 平衡チェック
提出
code: txt
from collections import dequeue
def is_balance(g):
visited = set()
q = dequeue()
q.add(g
0
)
while q:
next = q.popleft()
for node in